package com.castle.fortress.admin.flowable.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 审批模式类型
 * @author  castle
 */
@Getter
@AllArgsConstructor
public enum FlowableApproveModeEnum {
    AND(1,"AND","会签（可同时审批，每个人必须同意）"),
    OR(2,"OR","或签（有一人同意即可）"),
    NEXT(3,"NEXT","会签（按顺序依次审批，每个人必须同意）"),
    ;

    Integer code;
    String name;
    String desc;

    public static String getNameByCode(Integer code){
        for(FlowableApproveModeEnum e: FlowableApproveModeEnum.values()){
            if(e.getCode().equals(code)){
                return e.getName();
            }
        }
        return null;
    }
}
